

function changeImg(){
	var nextimg = document.getElementsByClassName("next");
	var bigtext2 = document.getElementById("bigtitletext2");
	var bigtext3 = document.getElementById("bigtitletext3");
	var arr = [];
	for(let z=3;z>=0;z--){
		
		arr[z] = setTimeout(function(){
			for(var j=0;j<nextimg.length;j++){
				nextimg[j].children[0].src = "img/index-next" + (z%2 + 1) + ".png"
			}
			bigtext2.children[0].src = "img/index-page1-bigtitletext2" + z + ".png";
			bigtext3.children[0].src = "img/index-page1-bigtitletext3" + z + ".png";
			clearTimeout(arr[z]);
		},35*(-z+3));
	}
	
}



var t = setInterval(function(){
	changeImg();
},2000);

var yuanqiu2 = document.getElementById("yuanqiu2");
var yuanqiu3 = document.getElementById("yuanqiu3");


yuanqiu2.addEventListener("animationstart",function(){
	document.getElementsByClassName("text2")[0].classList.add("text2active");
	document.getElementsByClassName("text3")[0].classList.remove("text3active");
	document.getElementById("taikongyi").classList.remove("taikongyia");
})
yuanqiu3.addEventListener("animationstart",function(){
	document.getElementsByClassName("text3")[0].classList.add("text3active");
	document.getElementsByClassName("text2")[0].classList.remove("text2active");
})

document.getElementById("taikongyi").addEventListener("animationend",function(){
	document.getElementById("taikongyi").classList.add("taikongyia");
})

document.getElementById("guize").addEventListener("click",function(){
	document.getElementsByClassName("guize")[0].style.transform = "translateY(0)";
})

document.getElementById("start").addEventListener("click",function(){
	location = "game1.html";
})

var guanbi = document.getElementById("guanbi");
guanbi.addEventListener("click",function(){
	document.getElementsByClassName("guize")[0].style.transform = "translateY(100%)";
})